{extend name='admin@main'}

{block name="button"}

{/block}

{block name="content"}

<div class="think-box-shadow">
    {include file='order/order/index_search'}
	<div class="layui-tab layui-tab-card think-bg-white">
        <ul class="layui-tab-title notselect">
            <li data-type='' {if ($Think.get.status eq 0) && (!in_array($Think.get.overdue_status,[2,3]))} class="layui-this" {/if} data-open='{:url("")}?status=0&page=1'>全部</li>
            <li data-type="" {if $Think.get.status eq 1} class="layui-this" {/if} data-open='{:url("")}?status=1&page=1'>正常</li>
            <li data-type="" {if $Think.get.status eq 2} class="layui-this" {/if} data-open='{:url("")}?status=2&page=1'>已取消</li>
            <li data-type="" {if $Think.get.status eq 3} class="layui-this" {/if} data-open='{:url("")}?status=3&page=1'>部分退款</li>
            <li data-type="" {if $Think.get.overdue_status eq 2} class="layui-this" {/if} data-open='{:url("")}?overdue_status=2&page=1'>即将逾期<span class="layui-badge">{$overdue_warning_soon}</span></li>
            <li data-type="" {if $Think.get.overdue_status eq 3} class="layui-this" {/if} data-open='{:url("")}?overdue_status=3&page=1'>已逾期<span class="layui-badge">{$overdue_soon}</span></li>
            <li data-type="" {if in_array($Think.get.checkpic_status,[3,4])} class="layui-this" {/if} data-open='{:url("")}?checkpic_status=3&page=1'>效果图预警<span class="layui-badge">{$checkpic_warning_soon}</span></li>
            <li data-type="" {if $Think.get.checkpic_status eq 5} class="layui-this" {/if} data-open='{:url("")}?checkpic_status=5&page=1'>发邮箱预警<span class="layui-badge">{$sendemail_soon}</span></li>
            <li data-type='' style="float:right;">共 {$page.total} 条记录</li>
        </ul>
    </div>
    <div class="layui-obj">
    	{if auth("admin/order.order/add")}
        <button data-open='{:url("add")}' data-title="添加订单" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
        {/if}
        {if auth("admin/order.order/make")}
        <button data-modal-special='{:url("make")}' data-title="制作情况" class='layui-btn layui-btn-sm layui-btn-primary'>制作情况</button>
        {/if}       
        <!--{if auth("admin/order.order/label")}
        <button data-modal-special='{:url("label")}' data-title="打印标签" class='layui-btn layui-btn-sm layui-btn-primary'>打印标签</button>
        {/if}-->
        {if auth("admin/order.order/detection")}
        <button data-modal-special='{:url("detection")}' data-title="质检状态" class='layui-btn layui-btn-sm layui-btn-primary'>质检状态</button>
        {/if}
        {if auth("admin/order.order/pack")}
        <button data-modal-special='{:url("pack")}' data-title="打包状态" class='layui-btn layui-btn-sm layui-btn-primary'>打包状态</button>
        {/if}
        {if auth("admin/order.order/delivery")}
        <button data-modal-special='{:url("delivery")}' data-title="发货状态" class='layui-btn layui-btn-sm layui-btn-primary'>发货状态</button>
        {/if}
        {if auth("admin/order.order/arrange")}
        <button data-modal-special='{:url("arrange")}' data-title="整理日期" class='layui-btn layui-btn-sm layui-btn-primary'>整理日期</button>
        {/if}
        {if auth("admin/order.order/draw")}
        <button data-modal-special='{:url("draw")}' data-title="绘画日期" class='layui-btn layui-btn-sm layui-btn-primary'>绘画日期</button>
        {/if}
        {if auth("admin/order.order/batch_print")}
        <button data-modal-special='{:url("batch_print")}' data-title="制版状态" class='layui-btn layui-btn-sm layui-btn-primary'>制版状态</button>
        {/if}
        {if auth("admin/order.order/painter")}
        <button data-modal-special='{:url("painter")}' data-title="画手" class='layui-btn layui-btn-sm layui-btn-primary'>画手</button>
        {/if}
    </div>
    <table class="layui-table margin-top-0" lay-skin="line" data-export-name='table' lay-filter="tecd">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>订单号</th>
            <th class='text-left nowrap'>所属店铺</th>
            <th class="text-left">下单日期</th>                     
            <th class="text-left">画手</th>
            <th class="text-left">客服沟通情况</th>
            <th class='text-left'>画手姓名</th>
            <th class='text-left'>制版状态</th>
            <th class="text-left">制作情况</th>                                                  
            <th class="text-left">客户图片</th>
            <th class="text-left">绘画日期</th>  
            <th class="text-left">备注</th>
            <th class="text-left">订单状态</th>
            <th>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class='text-left nowrap'>
            	{$vo.code|default=''}
            	{if $vo.urgent eq 2}
            	<span class="layui-badge layui-bg-red">急</span>
            	{/if}
            </td>
            <td class='text-left nowrap'>{$vo.shop_name|default=''}</td>
            <td class='text-left nowrap'>
                {$vo.create_order_at|default=''}
            </td>         
            <td class='text-left nowrap'>
                {$vo.painter_cn|default=''}
            </td>           
            <td class='text-left nowrap'>
                {$vo.kefu_exchange_cn|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.painter_name_cn|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.is_print_cn|default=''}
            </td>
            <td class='text-left nowrap'>
                {$vo.make_status_cn|default=''}
            </td>                        
            <td class='text-center nowrap'>
            	{if $vo.custom_first_pic eq true}
                <img alt="icon" data-tips-image style="height:100px; width: 100px;border: 1px solid #e6e6e6; display: block;" src="{$vo.custom_first_pic|default='__ROOT__/static/admin/img/jcfw.png'}"/>
                {/if}
            </td>
            <td class='text-left nowrap'>
                {$vo.draw_at|default=''}
            </td>
			<td class='text-left nowrap'>
				<textarea name="" rows="5" cols="20"  disabled="disabled" style="color: red;font-weight: bold;">{$vo.desc|default=''}</textarea>               
            </td>
            <td class='text-left nowrap'>
            	{if $vo.status eq 1}
            	<span class="color-green">{$vo.status_cn|default=''}</span>
                {elseif $vo.status eq 2}
                <span class="color-red">{$vo.status_cn|default=''}</span>
                {elseif $vo.status eq 3}  
                <span style="color: #FFB800;">{$vo.status_cn|default=''}</span>
                {/if}
            </td>
            <td class='text-left nowrap'>            	
            	{if auth("admin/order.order/browse")}
                	<a data-dbclick data-title="查看订单" class="layui-btn layui-btn-warm layui-btn-sm" data-open='{:url("browse")}?id={$vo.id}'>查 看</a>
                {/if}
                {if auth("admin/order.order/edit")}               	
                	<a data-dbclick data-title="编辑订单" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>               	
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}


</div>
<style>
    .layui-obj{
        margin-top: 10px!important;
    }
    .layui-tab{
        margin-top: 10px!important;
    }
	.layui-table td, .layui-table th {
		box-sizing: border-box;
	}
</style>
<script>

</script>
{/block}

